package com.hospital.controller;

import com.hospital.entity.ResponsibleDepartment;
import com.hospital.service.DepartmentService;
import com.hospital.util.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 科室操作Controller层
 */
@Controller
@RequestMapping("Department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;
    @Autowired
    private JsonUtil jsonUtil;

    @RequestMapping("Insert")
    @ResponseBody
    public Boolean Insert(ResponsibleDepartment responsibleDepartment) {
        Integer state = departmentService.Insert(responsibleDepartment);
        jsonUtil.setRestate(state == 1);
        return jsonUtil.getRestate();
    }
}
